package com.evil.common.account.dto;

import com.evil.common.core.dto.FindByStringReqDTO;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @author liyang
 * @date 2023-02-16 14:54
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class FindByNameAndEIdReqDTO extends FindByStringReqDTO {

    /**
     * 企业ID
     */
    private Long enterpriseId;

    public FindByNameAndEIdReqDTO(String string, Boolean filterDeleted, Boolean cache, Long enterpriseId) {
        super(string, filterDeleted, cache);
        this.enterpriseId = enterpriseId;
    }

    public static FindByNameAndEIdReqDTO filter(Long enterpriseId, String string) {
        return new FindByNameAndEIdReqDTO(string, true, false, enterpriseId);
    }

    public static FindByNameAndEIdReqDTO unFilter(Long enterpriseId, String string) {
        return new FindByNameAndEIdReqDTO(string, false, false, enterpriseId);
    }

    public static FindByNameAndEIdReqDTO filterCache(Long enterpriseId, String string) {
        return new FindByNameAndEIdReqDTO(string, true, true, enterpriseId);
    }

    public static FindByNameAndEIdReqDTO unFilterCache(Long enterpriseId, String string) {
        return new FindByNameAndEIdReqDTO(string, false, true, enterpriseId);
    }
}
